<script lang='ts' setup name='App'>
import { ref } from "vue";

const containter = ref()//代表页面的dom元素

function invoke() {
      console.log("按钮被点击了");
      const h3 = document.createElement("h3");
      h3.innerHTML = '当前时间: '+new Date()
      containter.value.append(h3)
}

//键盘的事件
function inputChange(event:Event){
      // console.log(event)
      // const data = event.data;

      const inputEvent = event as InputEvent
      const {data} = inputEvent;
      console.log(data)
}


</script>

<template>

      <button @click="invoke">点我执行一句话</button>
      <input type="text" @input="inputChange">
      <div ref="containter">



      </div>

</template>


<style></style>